package com.scapegoat.pay.notify.service.api;

import com.scapegoat.pay.common.core.page.PageBean;
import com.scapegoat.pay.common.core.page.PageParam;
import com.scapegoat.pay.notify.service.entity.RpNotifyRecord;
import com.scapegoat.pay.notify.service.entity.RpNotifyRecordLog;
import com.scapegoat.pay.notify.service.exceptions.NotifyBizException;

import java.util.Map;


public interface RpNotifyService {

    /**
     * 发送消息通知
     *
     * @param notifyUrl       通知地址
     * @param merchantOrderNo 商户订单号
     * @param merchantNo      商户编号
     */
    void notifySend(String notifyUrl, String merchantOrderNo, String merchantNo) throws NotifyBizException;

    /**
     * 通过ID获取通知记录
     *
     * @param id
     * @return
     */
    RpNotifyRecord getNotifyRecordById(String id) throws NotifyBizException;

    /**
     * 根据商户编号,商户订单号,通知类型获取通知记录
     *
     * @param merchantNo      商户编号
     * @param merchantOrderNo 商户订单号
     * @param notifyType      消息类型
     * @return
     */
    RpNotifyRecord getNotifyByMerchantNoAndMerchantOrderNoAndNotifyType(String merchantNo, String merchantOrderNo, String notifyType) throws NotifyBizException;


    PageBean<RpNotifyRecord> queryNotifyRecordListPage(PageParam pageParam, Map<String, Object> paramMap) throws NotifyBizException;

    /**
     * 创建消息通知
     *
     * @param rpNotifyRecord
     */
    long createNotifyRecord(RpNotifyRecord rpNotifyRecord) throws NotifyBizException;

    /**
     * 修改消息通知
     *
     * @param rpNotifyRecord
     */
    void updateNotifyRecord(RpNotifyRecord rpNotifyRecord) throws NotifyBizException;

    /**
     * 创建消息通知记录
     *
     * @param rpNotifyRecordLog
     * @return
     */
    long createNotifyRecordLog(RpNotifyRecordLog rpNotifyRecordLog) throws NotifyBizException;

}
